import Vue from 'vue';
import ElementUI from 'element-ui';
import App from './views/App.vue';
import router from './router/router';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/index.less';
import './assets/css/iconfont/iconfont.css';
import store from './store/store';
import animated from "animate.css";
import Empty from "./components/notFind.vue"; // 无内容组件
import {addDebounceDirective,addThrottleDirective} from './utils/debounce';
import http from './utils/request';
import {getConfig} from "@/api/apis";
import global from './utils/global';
/**
 * loadsh
 * addDebounceDirective 按钮防抖处理
 * addThrottleDirective 按钮节流处理
 * 指令方式
 * v-debounce-click 防抖 <el-button v-debounce-click="method"/>
 * v-debounce-click 节流 <el-button v-throttle-click="method"/>
 */
addDebounceDirective(Vue);
addThrottleDirective(Vue);
Vue.use(animated);
Vue.use(ElementUI,{
  size:'small'
});
Vue.component('empty', Empty)


getConfig().then(
  (apis) => {
    new Vue({
      router,
      store,
      render: (h) => h(App),
      beforeMount() {
        Vue.prototype.$http = http;
        Vue.prototype.$API = apis;
        Vue.prototype.$GLOBAL = global;
    }
    }).$mount('#app');
  }
);
